-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IMPORTANT - Fixing collecting data from observers when using batch observer in first run #1470
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1470 +/- ##
==========================================
- Coverage 94.07% 93.93% -0.14%
==========================================
Files 153 148 -5
Lines 4656 4401 -255
Branches 959 899 -60
==========================================
- Hits 4380 4134 -246
+ Misses 276 267 -9
|
@open-telemetry/javascript-approvers this is important bug fix, please have a look, thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR-wise LGTM.
However, I'm wondering if a batch observer should be an instance of Metric. According to https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/api.md#batch-observer the batch observers merely acts as an co-ordinator for other instruments. There may not be possibly instruments can be bound by the batch observer. Yet the implementation of BatchObserverMetric
does inherit from Metric
which can be bound to create new instruments -> those created instruments can not be updated by the callback of BatchObserverMetric
.
In my thoughts, BatchObserverMetric
can be simplified as separate categories with metrics and reduce confusion that BatchObserverMetric
itself can be updated with values, and rename BatchObserverMetric
to BatchObserver
to indicate that itself is not a Metric.
I agree with @legendecas but let's get this bugfix merged then we can follow up if all agree |
Lets investigate this in separate PR -> #1489 |
I discovered a bug when using batch observer. The batch observers needs to be run first so that the batcher can update observers first. After this the rest of observers and metrics should be run to collect the data. Otherwise when using the batch observers the
meter.getBatcher().checkPointSet()
was returning 0 records at first run.